package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.UUID;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DataCollectionMapper;
import com.ruoyi.system.domain.DataCollection;
import com.ruoyi.system.service.IDataCollectionService;

/**
 * 数据采集结果汇总Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-22
 */
@Service
public class DataCollectionServiceImpl implements IDataCollectionService 
{
    @Autowired
    private DataCollectionMapper dataCollectionMapper;

    /**
     * 查询数据采集结果汇总
     * 
     * @param id 数据采集结果汇总主键
     * @return 数据采集结果汇总
     */
    @Override
    public DataCollection selectDataCollectionById(String id)
    {
        return dataCollectionMapper.selectDataCollectionById(id);
    }

    /**
     * 查询数据采集结果汇总列表
     * 
     * @param dataCollection 数据采集结果汇总
     * @return 数据采集结果汇总
     */
    @Override
    public List<DataCollection> selectDataCollectionList(DataCollection dataCollection)
    {
        return dataCollectionMapper.selectDataCollectionList(dataCollection);
    }

    /**
     * 新增数据采集结果汇总
     * 
     * @param dataCollection 数据采集结果汇总
     * @return 结果
     */
    @Override
    public int insertDataCollection(DataCollection dataCollection)
    {
        if(StringUtils.isBlank(dataCollection.getId())){
            dataCollection.setId(UUID.randomUUID().toString());
        }
        return dataCollectionMapper.insertDataCollection(dataCollection);
    }

    /**
     * 修改数据采集结果汇总
     * 
     * @param dataCollection 数据采集结果汇总
     * @return 结果
     */
    @Override
    public int updateDataCollection(DataCollection dataCollection)
    {
        return dataCollectionMapper.updateDataCollection(dataCollection);
    }

    /**
     * 批量删除数据采集结果汇总
     * 
     * @param ids 需要删除的数据采集结果汇总主键
     * @return 结果
     */
    @Override
    public int deleteDataCollectionByIds(String[] ids)
    {
        return dataCollectionMapper.deleteDataCollectionByIds(ids);
    }

    /**
     * 删除数据采集结果汇总信息
     * 
     * @param id 数据采集结果汇总主键
     * @return 结果
     */
    @Override
    public int deleteDataCollectionById(String id)
    {
        return dataCollectionMapper.deleteDataCollectionById(id);
    }
}
